1. Field of the Invention
The present invention relates to a technique for correcting white balance and density of a color image when digital image processing is performed on an input image signal to form a print, more particularly, to a method and an apparatus for correcting white balance, a method for correcting density and a recording medium on which a program for carrying out these methods is recorded.
2. Description of the Related Art
The conventional silver salt photography generally uses an analog exposure (area exposure or direct exposure) system to obtain a print. That is, a developed negative film is positioned at a predetermined printing position and irradiated with light from a white light source (halogen lamp or the like), and light transmitted through the negative film is imaged on photographic paper, thus making an exposure.
In recent years, printing apparatuses using digital exposure, i.e., digital photoprinters, have been put to practical use. Digital photoprinters perform a process in which an image recorded on a photographic film such as a negative film or a color reversal film is photoelectrically read to obtain a digital signal representing the read image, various kinds of image processing is performed on the digital signal to obtain image data, scanning exposure using recording light modulated according to this image data is performed on a photosensitive material to form an image (latent image) on the photosensitive material to obtain a (finished) print.
Such digital photoprinters process images as digital image data and can therefore perform image processing not only on photographed images on photographic films but also on photographed images obtained with digital still cameras (DSC) or the like, image data recording in the form of digital data on various kinds of recording media, e.g., magnetic recording media, such as CD-R (compact disk recordable), floppy disks, and removable hard disks (Zip, Jaz, etc.), and MO disks (magneto-optical recording media) to output prints.
Color negative films have been commonly used by typical users. The conditions of photography of original images on negative films are not always uniform. For example, subjects are photographed in light from various light sources, e.g., daylight and fluorescent lamp. Therefore, in case of forming prints from a developed negative film when images in the developed negative film is printed without changing the characteristics of light from a printing light source, color tints of light from photographing light sources in which subjects have been photographed are directly reflected in the prints, which leads to forming undesirable prints in some cases.
Various systems have therefore been contrived to adjust white balance on the prints. A typical example of such systems is a large area transmission density (LATD) method based on the Evans' theorem (hypothesis) stating that the average of all colors in the world is gray. The LATD is the average transmission density through an entire frame on a photographic film. In the LATD method, the LATD of each frame on a color negative film is measured and the characteristics of a printing light source are changed according to the red, green and blue density levels so that the average color on the print is close to gray.
On the other hand, digital still cameras (DSCs) have recently come into widespread use. An image forming process in a DSC and an image forming process using a color negative film can be regarded as the same with respect to photographing a scene but differ essentially in that a DSC image itself is an object of appreciation while an image on a color negative film is not directly viewed as an object of appreciation. DSC images themselves, therefore, must be fine, well-white-balanced images when viewed before being output as prints. DSCs are also used for photography with various light sources like cameras using color negative films and are unable to reliably obtain a satisfactory image without a function for correcting white balance. Therefore almost all the recent DSCs have an auto white balance (AWB) function for automatically correcting white balance.
The above-described LATD method has been practiced with some measure of success but it is responsible for production of undesirable prints. One of the printing failures due to the LATD method is color failure that imbalance of a color occurs in a print. For example, in a case where white balance correction based on the LATD method is made on an image obtained by photographing a woman in red dress, a cyan color, which is a complementary color to red, is added throughout the entire frame to make the entire frame close to gray, thereby reducing the vividness of the red of the dress and making the woman's face pale.
In a case where the entire frame area of a photographed scene is reddish, it is impossible to ascertain whether the reddishness is ascribable to the light source or the subject. In this case, the LATD method achieves success in correction if the light source is the cause, but it causes such a color failure described above if the subject is the cause.
The above-mentioned AWB function of DSCs is essentially based on the Evans' theorem like the negative film/printing system and entails the same problem as that of white balance correction based on the LATD in the negative film/printing system.
That is, while about 60 to 70% of DSC images after AWB are obtained as well-color-balanced good images as average performance of the Evans' theorem, the remaining 30 to 40% of the DSC images need some additional color balance correction because of AWB function failure. If white balancing is not performed at the time of printing from the DSC images, about 30 to 40% of resulting prints are unsatisfactory, unacceptable prints.
As described above, the conventional art LATD method based on the Evans' theorem makes white balance correction by assuming that the average of colors through the entire frame of an image is gray, but it is not sufficiently effective in correcting white balance because of its inability to find true gray in an image, and often produces a contrary correction effect.
Further, when printing, if LATD method as above is employed to perform density correction through the entire image the density of a main subject or a principal subject in the image will be influenced by scene configurations and a print may be formed with an improper density. In order to overcome such a problem, it has been proposed to detect a main subject (a human face in many cases) in an image and determine the print density in accordance with the density of the detected subject. The judgment on whether or not the print density is proper is made based on the density of a main subject rather than the density through an entire frame. Consequently, it is important to detect a human face as a main subject and correct the density of the entire image so that the density of the face may be proper.
Detection of a human face as a main subject is generally performed employing shape recognition. However, it is very difficult at present to detect human faces with high accuracy by employing such measures. It has also been attempted to detect human faces using color information, where difficulties may again occur, if the type of a light source is unknown.